<div class="titulos">Usuários do Sistema :: Alterar</div>
    <div class="usuarios form">
    
    <?php echo $this->Form->create('Usuario'); ?>
        <table id="tabela_mvc">
            <input type="hidden" id="UsuarioId" value="<?php echo $this->data['Usuario']['id']; ?>" name="data[Usuario][id]"/>
            <tr>
                <th>Usuário: </th>
                <td><?php echo $this->data['Usuario']['usuario']; ?></td>
            </tr>
            <tr>
                <th>Nome: </th>
                <td><input type="text" class="validateRequired" id="Nome" size="50" value="<?php echo $this->data['Usuario']['nome']; ?>" maxlength="100" name="data[Usuario][nome]" /></td>
            </tr>
            <tr>
                <th>Perfil de Acesso:</th>
                <td>
                    <table class="interno">
                        <tr>
                            <th><?php __('Descrição'); ?></th>
                            <th><?php __('Menu'); ?></th>
                            <th><?php __('Visualizar'); ?></th>
                            <th><?php __('Inserir'); ?></th>
                            <th><?php __('Alterar'); ?></th>
                            <th><?php __('Excluir'); ?></th>
                        </tr>
                        <?php $i = 0; foreach ($lista_menu as $menu): ?>
                            <tr>
                                <input type="hidden" value="<?php echo $menu['Menu']['id']; ?>" name="data[PerfilAcesso][<?php echo $i; ?>][menu_id]" />
                                <td><a href="#" rel="htmltooltip" class="link_tooltip"><?php echo $menu['Menu']['menu']; ?></a><div class="htmltooltip"><?php echo $menu['Menu']['descricao']; ?></div></td>
                                <th><input type="checkbox" name="data[PerfilAcesso][<?php echo $i; ?>][menu]" value="1" <?php echo isset($menu['PerfilAcesso']['0']['menu'])?$menu['PerfilAcesso']['0']['menu']==1?'checked':'':''; ?> /></th>
                                <th><?php if ($menu['Menu']['visualizar']){ ?><input type="checkbox" name="data[PerfilAcesso][<?php echo $i; ?>][visualizar]" value="1" <?php echo isset($menu['PerfilAcesso']['0']['visualizar'])?$menu['PerfilAcesso']['0']['visualizar']==1?'checked':'':''; ?> /><?php } else echo '&nbsp;'; ?></th>
                                <th><?php if ($menu['Menu']['inserir']){ ?><input type="checkbox" name="data[PerfilAcesso][<?php echo $i; ?>][inserir]" value="1" <?php echo isset($menu['PerfilAcesso']['0']['inserir'])?$menu['PerfilAcesso']['0']['inserir']==1?'checked':'':''; ?> /><?php } else echo '&nbsp;'; ?></th>
                                <th><?php if ($menu['Menu']['alterar']){ ?><input type="checkbox" name="data[PerfilAcesso][<?php echo $i; ?>][alterar]" value="1" <?php echo isset($menu['PerfilAcesso']['0']['alterar'])?$menu['PerfilAcesso']['0']['alterar']==1?'checked':'':''; ?> /><?php } else echo '&nbsp;'; ?></th>
                                <th><?php if ($menu['Menu']['excluir']){ ?><input type="checkbox" name="data[PerfilAcesso][<?php echo $i; ?>][excluir]" value="1" <?php echo isset($menu['PerfilAcesso']['0']['excluir'])?$menu['PerfilAcesso']['0']['excluir']==1?'checked':'':''; ?> /><?php } else echo '&nbsp;'; ?></th>
                            </tr>
                        <?php $i++; endforeach; ?>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="2" class="nobg">
                    <?php  
                        $url = "'".$html->url(array('action' => 'index'))."'"; 
                        echo $form->button(__("Voltar", true), array("class" => "botao", 'onclick' => 'location.href='.$url,'type'=>'button' )); 
                    ?>
                    <input type="submit" value="Salvar" class="botao" />
                </td>
            </tr>
        </table>
    </div>